package Backend;
/* @author dara */

public class Song {
	private String title;
	private int plays;
	// Initialize to avoid fuck-ups when calling getFilepath()
	private String filepath = "";

	public Song(String title, int plays) {
		this.title = title;
		this.plays = plays;
	}

	public Song(String title, int plays, String location) {
		this.title = title;
		this.plays = plays;
		this.filepath = location;
	}

	public String toString() {
		return "[" + title + ": " + plays + ": " + filepath + "]";
	}

	public String getTitle() {
		return title;
	}

	public int getPlays() {
		if (plays >= 255)
			return 255;
		if (plays <= 0)
			return 0;
		return plays;
	}

	public void incrementPlays() {
		plays = plays + 5;
	}

	public void decrementPlays() {
		plays = plays - 5;
	}

	public String getFilepath() {
		return this.filepath;
	}

}
